<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head th:replace="common/head::head">
</head>

<body>

<blockquote class="layui-elem-quote">当前程序打包时间：
    <span timeStamp> </span>
</blockquote>
<blockquote class="layui-elem-quote">当前版本号：
    <span version></span>
</blockquote>
<blockquote class="layui-elem-quote">已经运行时间：
    <span upTime></span>
</blockquote>

<div class="layui-row" style="display: none;" id="selectFile">
    <button type="button" class="layui-btn layui-col-md-offset5" id="uploadJar">
        <i class="layui-icon">&#xe67c;</i>上传新包
    </button>
</div>

</body>
<script>
    function loadSuccess() {
        loadingAjax({
            url: './info',
            data: {
                nodeId: "[[${node?.id}]]"
            },
            success: function (data) {
                if (200 != data.code) {
                    layer.alert(data.msg);
                    return;
                }
                for (var key in data.data) {
                    $("span[" + key.toLowerCase() + "]").text(data.data[key]);
                }
                if (data.data.debug === false) {
                    $("#selectFile").show()
                }
            }
        });


        uploadRender({
            elem: '#uploadJar',
            url: './uploadJar.json',
            data: {},
            exts: 'jar',
            openTop: true,
            acceptMime: '.jar',
            done: function (res) {
                top.layer.closeAll('loading');
                if (200 === res.code) {
                    top.layer.msg('系统升级中..', {
                        icon: 16,
                        shade: 0.2,
                        time: 1000 * 30,
                        end: function () {
                            top.location.reload();
                        }
                    });
                } else {
                    layer.alert(res.msg);
                }
            }
        }, function () {

        });
    }
</script>
</html>
